package com.woniuxy.springparking.controller;

import com.woniuxy.springparking.asepct.SysLog;
import com.woniuxy.springparking.common.RestDto;
import com.woniuxy.springparking.common.RestResult;
import com.woniuxy.springparking.service.TPerAuthService;
import com.woniuxy.springparking.vo.TPerAuthVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
public class TPerAuthController {
    @Autowired
    private TPerAuthService tPerAuthService;
    @GetMapping("/TASelectByPage.do")
    @ApiOperation(value = "分页查询所有用户认证信息",httpMethod = "GET",
            protocols = "HTTP",produces = "application/json",
            response = RestResult.class,notes = "分页查询所有用户认证信息")
    public RestResult taSelectByPage(TPerAuthVo tPerAuthVo){
        return tPerAuthService.findTAByPage(tPerAuthVo);
    }

    @PostMapping("/updateAStatus.do")
    @ApiOperation(value = "按id更新用户认证状态",httpMethod = "POST",
            protocols = "HTTP",produces = "application/json",
            response = RestDto.class,notes = "更新用户认证状态")
    @SysLog(value1 = "更新",value2 = "更新用户认证状态")
    public RestDto xgCoupon(Integer perAuthStatus, Integer perAuthId){
        RestDto dto=new RestDto();
        this.tPerAuthService.updateAuth(perAuthStatus,perAuthId);
        dto.setCode(200);
        dto.setMsg("修改成功");
        return dto;
    }

}
